<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterMqErrorLogAddRetryNum extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('mq_error_log', function (Blueprint $table) {
            $table->unsignedTinyInteger('retry_num')->default(0)->comment('重试次数')->after('payload');
            $table->unsignedTinyInteger('retry_status')->default(1)->comment('重试状态。1：待重试；2：已重试；3：消费成功')->after('payload');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('mq_error_log', function (Blueprint $table) {
            $table->dropColumn('retry_num');
            $table->dropColumn('retry_status');
        });
    }
}
